﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using static DevExpress.Utils.Filtering.ExcelFilterOptions;


namespace 机器组和机器编辑
{
    public partial class AddConfigurationForm : Form
    {
        public string GroupName => textBox1.Text; // 组名称
        public bool ConfigurationEnabled => checkBox1.Checked; //配置项
        public string SelectedLanguage => comboBox2.SelectedItem?.ToString(); //配置语言
        public string SelectedType => comboBox1.SelectedItem?.ToString(); //类型
        public int NextID { set => textBox5.Text = value.ToString(); } //ID（仅可读）

        public AddConfigurationForm()
        {
            InitializeComponent();
        }
        private void label5_Click(object sender, EventArgs e)
        {

        }
        private void label6_Click(object sender, EventArgs e)
        {

        }
        private void Form2_Load(object sender, EventArgs e)
        {
            
        }
        private void button1_Click(object sender, EventArgs e) //确定按钮点击事件
        {
            if (string.IsNullOrWhiteSpace(textBox1.Text))
            {
                MessageBox.Show("组名称不能为空", "输入错误",
                    MessageBoxButtons.OK, MessageBoxIcon.Warning);
                textBox1.Focus();
                return;
            }
            this.DialogResult = DialogResult.OK;
            this.Close();
        }

        private void button2_Click(object sender, EventArgs e) //取消按钮点击事件
        {
            this.DialogResult = DialogResult.Cancel;
            this.Close();
        }
    }
}
